<form action="" class="form-horizontal" data-toggle="validator" id="edit-form" method="POST" role="form">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Order_sn')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input class="form-control" data-rule="required" id="c-order_sn" name="row[order_sn]" type="text"
                   value="{$row.order_sn|htmlentities}">
        </div>
    </div>
    {if $row.type_id == 1 }
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Template Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input class="form-control" data-rule="required" id="c-template_id" name="row[template_name]" type="text"
                   value="{$row.template_name|htmlentities}">
        </div>
    </div>
    {/if}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Username')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input class="form-control" data-field="nickname" data-rule="required" id="c-user_id" name="row[username]"
                   type="text" value="{$row.username|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input class="form-control" data-rule="required" id="c-price" name="row[price]" type="number"
                   value="{$row.price|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Pay_state')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input class="form-control" data-rule="required" id="c-pay_state" name="row[pay_state]" type="text"
                   value="{$row.pay_state|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Paytime')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true"
                   id="c-paytime" name="row[paytime]" type="text"
                   value="{:$row.paytime?datetime($row.paytime):''}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input class="form-control" id="c-type" name="row[type]" type="text" value="{$row.type|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Createtime')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input class="form-control" id="c-createtime" name="row[createtime]" type="text"
                   value="{$row.createtime|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Updatetime')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input class="form-control" id="c-updatetime" name="row[createtime]" type="text"
                   value="{$row.createtime|htmlentities}">
        </div>
    </div>
    {if $row.type_id == 2 }
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('引用的碳排放因子列表')}:</label>
        <div class="col-xs-12 col-sm-8">
            <dl class="fieldlist" data-name="row[factorList]">
                <dd style="display: flex; justify-content: space-between; padding-bottom: 10px;">
                    <ins>{:__('因子编号')}</ins>
                    <ins>{:__('因子名称')}</ins>
                    <ins>{:__('价格')}</ins>
                    <ins>{:__('所属人')}</ins>
                </dd>
                {foreach $row->factorList as $factor}
                <dd style="display: flex; justify-content: space-between; padding-bottom: 10px;">
                    <ins>{$factor['sn']}</ins>
                    <ins>{$factor['name']}</ins>
                    <ins>{$factor['price']}</ins>
                    <ins>{$factor['username']}</ins>
                </dd>
                {/foreach}
            </dl>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('引用的模板列表')}:</label>
        <div class="col-xs-12 col-sm-8">
            <dl class="fieldlist" data-name="row[templates]">
                <dd style="display: flex; justify-content: space-between; padding-bottom: 10px;">
                    <ins>{:__('模板编号')}</ins>
                    <ins>{:__('模板名称')}</ins>
                    <ins>{:__('价格')}</ins>
                    <ins>{:__('所属人')}</ins>
                </dd>
                {foreach $row->templates as $template}
                <dd style="display: flex; justify-content: space-between; padding-bottom: 10px;">
                    <ins>{$template['sn']}</ins>
                    <ins>{$template['name']}</ins>
                    <ins>{$template['price']}</ins>
                    <ins>{$template['username']}</ins>
                </dd>
                {/foreach}
            </dl>
        </div>
    </div>
    {/if}

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button class="btn btn-default btn-embossed" onclick="parent.Layer.closeAll();" type="button">
                {:__('Close')}
            </button>
        </div>
    </div>
</form>
